﻿<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">
    <link rel="stylesheet" href="/static/css/common/reset.css" />
    <link rel="stylesheet" href="/static/css/associate.css" />
    <link rel="stylesheet" href="/static/css/sweetalert.min.css" />
    <title>社团首页</title>
</head>
<body>
    <div class="inviteDetail">
        <div id="divHeader"></div>
        <section class="main pt10">
            <ul class="support-ul pt10 clearfix">
                <li>首页</li>
                <li>社团</li>
                <li>赞助筹备</li>
                <li>社团筹备</li>
                <li>详情查看</li>
            </ul>
        </section>
        <div ng-app="myApp">
            <div ng-controller="sponsorContractCtrl" ng-model="names">
                <section class="main">
                    <div class="support-activity">
                        <h1 class="f20 textcenter">{{names.ProjectName}}</h1>
                        <h2 class="textcenter mt10">{{names.CreateDate}}      <span class="colorRed">200</span>人已浏览</h2>
                        <h3 class="support-act-title f16 mb10">活动简介</h3>
                        <article class="line2">
                            <p ng-bind-html="names.Introduction | to_trusted"></p>
                        </article>
                        <a href="javascript:void(0)" class="support-act-editBtn">查看赞助详情</a>
                    </div>
                </section>
                <section class="main">
                    <ul class="support-list">
                        <li class="clearfix">
                            <div class="invite-list-content fl">
                                <div class="invite-lcontent-top clearfix">
                                    <p class="fl">赞助企业：{{names.Name}}</p>
                                    <p class="fr">{{names.ContractDate}}</p>
                                </div>
                                <p class="mt10 f14">
                                    <span>企业联系人：{{names.ContractorName}} </span>
                                    <span class="ml20">联系电话：{{names.ContractorPhone}}</span>
                                    <span class="ml20">QQ：{{names.ContractorQQ}}</span>
                                </p>
                                <div class="invite-lcontent-bottom">
                                    <label class="veraT f16 colorRed">社团承诺：</label>
                                    <p ng-bind-html="names.Supervision | to_trusted"></p>
                                </div>
                            </div>
                        </li>
                    </ul>
                    <div class="clearfix mb30">
                        <div class="invite-list-asset fr">
                            <p class="invite-lrtop-money">所需赞助金：<span>¥{{names.Amount}}</span></p>
                            <div class="support-lasset-bottom">
                                <a href="javascript:void(0);" ng-if="names.Status == 'Effective'" class="support-lrbottom-btn agree w100 fl">已经同意，并生成合同</a>
                                <a href="javascript:void(0);" tag="{{names.ContractID}}" ng-if="names.Status == 'Confirmed'" onclick="Update(this)" class="support-lrbottom-btn refuse w50 fl">取消，希望下次合作</a>
                                <a href="javascript:void(0);" ng-if="names.Status == 'Confirmed'" class="support-lrbottom-btn agree w50 fl">等待企业确定中</a>
                            </div>
                        </div>
                    </div>
                </section>
            </div>
        </div>
        <div id="divFooter"></div>
    </div>
</body>
</html>
<script type="text/javascript" src="/static/js/jquery-2.1.1.min.js"></script>
<script type="text/javascript" src="/static/js/common.js"></script>
<script type="text/javascript" src="/static/js/angular.min.js"></script>
<script type="text/javascript" src="/static/js/sweetalert.min.js"></script>
<script>

    var param = common.getUrlArgStr();
    if (!common.checkValue(param.id))
        window.location = "invite.html";

    $("#divHeader").load("/wuc/header.html");
    $("#divFooter").load("/wuc/footer.html");

    common.CreateController({ name: 'sponsorContractCtrl', url: '/api/project/GetSponsorContract?id=' + param.id, objType: 'dict', htmlFilter: true });

    function Update(obj) {

        var values = {};
        values.ContractID = $(obj).attr("tag");
        values.Status = 'Cancelled';

        common.commonAjax({ type: 'Post', url: '/api/project/UpdateContractStatus', data: values, sMethod: AfterUpdated, alert: true });
    }

    function AfterUpdated(ctx) {
        if (ctx == null) {
            common.alertMessage("无数据.");
            return;
        }

        window.location = "invite.html";
    }

</script>